<include file="Common:header" />
<div class="layui-card layadmin-header"> <span class="layui-breadcrumb" lay-separator="/"> <a href="{:U('Index/welcome')}">首页</a><a href="{:U('Member/index')}">会员管理</a> <a href="{:U('Member/add')}">添加内容</a> </span> </div>

<div class="layui-fluid pt-10 pr-10 pl-20">
	<div class="layui-btn-group demoTable">
		<button class="layui-btn" data-type="addData">添加</button>
		<button class="layui-btn" data-type="deleteData">删除</button>
	</div>
	<table class="layui-table mt-5" id="dataList" lay-filter="dataFilter">
	</table>
</div>
<script type="text/html" id="bar">
	<div class="layui-btn-group">
		<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>查看</a>
		<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="reset"><i class="layui-icon layui-icon-password"></i>重置密码</a>
		<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="allow"><i class="layui-icon layui-icon-ok"></i>激活</a>
		<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="close"><i class="layui-icon layui-icon-close"></i>禁用</a>
	</div>
</script>
<script type="text/html" id="createdTpl">
{{#  
	var fn = function(s){
		var time = new Date(parseInt(s)*1000);
		var y = time.getFullYear();
		var m = time.getMonth()+1;
		var d = time.getDate();
		var h = time.getHours();
		var mm = time.getMinutes();
		var s = time.getSeconds();
		return y + '-' + (m<10?'0'+m : m)+'-' +(d<10?'0'+d : d);
	}; 
}}
{{ fn(d.created) }}
</script>
<script type="text/html" id="statusTpl">
{{#  
	var fn = function(s){
		return s==1 ? '可用' : '禁用';
	}; 
}}
{{ fn(d.status) }}
</script>

<!--form name="listForm" id="listForm" method="post" action="{:U('Member/delete')}">
<table width="100%" class="content_table">
	<tr class="title">
		<td><input type="checkbox" id="checkAll"> 全选</td>
		<td><b>ID</b></td>
		<td><b>用户名</b></td>
		<td><b>姓名</b></td>
		<td><b>性别</b></td>
		<td><b>手机号</b></td>
		<td><b>邮箱</b></td>
		<td><b>状态</b></td>
		<td><b>锁定</b></td>
		<td><b>创建时间</b></td>
		<td><b>最后登录</b></td>
		<td><b>单项操作</b></td>
	</tr>
	<foreach name="data" item="val">
	<tr class="content">
		<td><input name="id[]" type="checkbox" value="{$val['id']}"></td>
		<td>{$val['id']}</td>
		<td>{$val['username']}</td>
		<td>{$val['realname']}</td>
		<td>
			<switch name="val['sex']">
				<case value="1">男</case>
				<case value="2">女</case>
				<default />保密
			</switch>
		</td>
		<td>{$val['phone']}</td>
		<td>{$val['email']}</td>
		<td>{$val['status']==1?'已激活':'未激活'}</td>
		<td>{$val['locked']==0?'正常':'已锁定'}</td>
		<td>{$val['created']|date="Y-m-d",###}</td>
		<td>{$val['lastdate']|date="Y-m-d",###}</td>
		<td>
			<a href="{:U('Member/add',array('id'=>$val['id']))}">查看</a>|<a href="javascript:if (confirm('确定删除?')) location='{:U('Member/delete',array('id'=>$val['id']))}'">删除</a>|<equal name="val['status']" value="0"><a href="{:U('Member/opration',array('id'=>$val['id'],'key'=>'status','value'=>1))}">激活</a>|</equal><equal name="val['status']" value="1"><a href="{:U('Member/opration',array('id'=>$val['id'],'key'=>'status','value'=>0))}">禁用</a>|</equal><equal name="val['locked']" value="0"><a href="{:U('Member/opration',array('id'=>$val['id'],'key'=>'locked','value'=>NOW_TIME))}">锁定</a>|</equal><gt name="val['locked']" value="0"><a href="{:U('Member/opration',array('id'=>$val['id'],'key'=>'locked','value'=>0))}">解锁</a>|</gt><a href="{:U('Member/opration',array('id'=>$val['id'],'key'=>'password','value'=>md5(C('DEFAULT_PASSWORD'))))}">重设密码</a>
		</td>
	</tr>
	</foreach>
	<tr>
		<td><input name="del" type="button" value="删 除" class="btn blue" /></td>
		<td colspan="11" class="pages">{$pagerData['linkhtml']}</td>
	</tr>
</table>
</form-->
<script>
layui.use(['member'], function(){
	var member = layui.member;
	member.init();
});
</script>
<include file="Common:footer" />